package com.ebupt.migu.music.userGroup.controller;

import com.ebupt.migu.music.common.entity.ResultObject;
import com.ebupt.migu.music.userGroup.entity.UserGroupInfo;
import com.ebupt.migu.music.userGroup.service.ProvinceCrowdService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 分省运营客群操作
 *
 * @author lemon
 * @since 2022-09-13 17:44
 */
@RestController
@RequestMapping("/province")
public class ProvinceCrowdController {

    @Resource
    private ProvinceCrowdService provinceCrowdService;

    /**
     * 查询目标人群
     *
     * @param userGroupInfo 人群查询条件
     * @return 目标人群
     */
    @PostMapping("/queryTargetCrowd")
    public ResultObject<List<UserGroupInfo>> queryTargetCrowd(@RequestBody UserGroupInfo userGroupInfo) {
        return provinceCrowdService.queryTargetCrowd(userGroupInfo);
    }
}
